package cc.facesign.acl.service.impl;

import cc.facesign.acl.bean.AclRoleMenu;
import cc.facesign.acl.mapper.AclRoleMenuMapper;
import cc.facesign.acl.service.AclRoleMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 角色菜单关联表 服务实现类
 * </p>
 *
 * @author acdongla
 * @since 2022-05-02
 */
@Service
@Transactional
public class AclRoleMenuServiceImpl extends ServiceImpl<AclRoleMenuMapper, AclRoleMenu> implements AclRoleMenuService {

    @Override
    public void relateBatch(List<AclRoleMenu> list) {
        baseMapper.relateBatch(list);
    }

    @Override
    public void deleteByRoleId(String roleId) {
        baseMapper.deleteByRoleId(roleId);
    }

    @Override
    public boolean existRelate(String roldId, String menuId) {
        return baseMapper.existRelate(roldId, menuId) >= 1;
    }


}
